<?php
  require_once('tpl/header.php');
?>

   <?php 
	//连接数据库；接收userlist传递过来的uid参数；根据uid从user表查询当前用户的信息
	
	// mysql_connect("localhost","root","");
	// mysql_select_db("neuvideo");
	// mysql_set_charset("utf8");
	require("inc_admin.php");
	connect();

	$uid=$_GET["uid"];
	// var_dump($uid);

	$sql="select * from users where uid=$uid";
	$result=mysql_query($sql);//结果集
	$row=mysql_fetch_assoc($result);//$row是个关联数组
	// var_dump($row);


	 ?>


	<h2>请修改用户信息</h2>
	<form action="doUserUpdate.php" method="post" enctype="multipart/form-data">
		<!-- 通过隐藏域传递uid参数，以便后面表单的使用 -->
		<input type="hidden" name="uid" value="<?php echo $row["uid"]; ?>">
		<!-- <input type="hidden" name="uid" value="<?php //echo $uid; ?>"> -->
		<table class="table table-bordered">
			<tr>
				<td>用户名</td>
				<td><input type="text" name="username" value="<?php echo $row["uname"]; ?>"readonly></td>
			</tr>
			<tr>
				<td>性别</td>
				<td><input type="radio" name="gender" value="0" <?php if($row["gender"]==0) echo "checked"; ?>>男
					<input type="radio" name="gender" value="1" <?php if ($row["gender"]==1) echo "checked"; ?>>女</td>
			</tr>
			<tr>
				<td>生日</td>
				<td><input type="date" name="birthdate" value="<?php echo $row["birthdate"]; ?>" ></td>
			</tr>
			<tr>
				<td>头像</td>
				<td><input type="file" name="pic" >
					原头像<img class="img-circle" src="../images/<?php echo $row["pic"]; ?>" alt="" width="100" height="100"> </td>
			</tr>
			<tr>
				<td>邮箱</td>
				<td><input type="email" name="email" value="<?php echo $row["email"] ?>"></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="更新">
					
				</td>
			</tr>
		</table>
		
	</form>


<?php
  require_once('tpl/footer.php');
?>